home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / BBS / MUBBS / MUBBS etc.cpt / Module Source / Module std routines / MUBBS Lock.c next >
Text File  |  1991-11-02  |  1KB  |  32 lines

  1. /*    This is the same code as in the think C libraries, it's just
  2.     shorter this way so that you don't have to include all the MacTraps
  3.     routines if you don't want to. (just to get this few lines of code
  4.     would be a MAJOR waste!)
  5.     
  6.     If you do include MacTraps for some reason, you need to remove this
  7.     file from your project. (or add code to it!)
  8.     
  9.     I urge you to conserve memory and NOT to just include files when
  10.     you really don't have to.
  11.     
  12. */
  13.  
  14. HLock(){
  15. asm{
  16.     movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
  17.     movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
  18.     _HLock
  19.     move.l A1,-(A7) /* put the return address back so we can return */
  20.     move.w d0,0x0220 /* put any error into global "MemErr" */
  21.     }
  22. }
  23.  
  24. HUnlock(){
  25. asm{
  26.     movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
  27.     movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
  28.     _HUnlock
  29.     move.l A1,-(A7) /* put the return address back so we can return */
  30.     move.w d0,0x0220 /* put any error into global "MemErr" */
  31.     }
  32. }